#ifndef RANKCALCULATOR_H
#define RANKCALCULATOR_H

#include <QtCore>
#include <QtGui>
#include <QMainWindow>
#include "ui_RankCalculator.h"

class RankCalculator : public QMainWindow{
	Q_OBJECT
public:
	RankCalculator( QWidget* parent = 0 );
private slots:
		QString numberOfFencersChanged( const QString & );
		QString nextButtonPressed();
		QString calculateButtonPressed();
		//QString callForValidation();
private:
	Ui::MainWindow ui;
	//variables
	QGroupBox* questionGroupBox;
	QGroupBox* groupMatrixGroupBox;
	QGroupBox* calculateAndOptionsGroupBox;
	QLabel* questionLabel;
	QLineEdit* questionLineEdit;
	QPushButton* questionButton;
	QSpacerItem* horizontalSpacer;
    QSpacerItem* horizontalSpacer_2;
	QVBoxLayout* gridVerticalLayout;
	QHBoxLayout* questionHorizontalLayout;
	QGridLayout* groupMatrixGridLayout;
	QHBoxLayout* calculateAndOptionsHorizontalLayout;
	int numberOfFencers;
	QMap<QString, QLineEdit*> lineMap;
	QMap<QString, QLabel*> labelMap; 
	QList<int> recordListF;
	QList<int> recordListA;
    QList<int> recordListV;
    QMap<int, QString> seedMap;
    QVector<QRadioButton* > *radioVector;
    QVector<QPair<int, QString>* > seedVector;
	//functions
	QString createQuestionGroupBox();
	QString createGroupMatrixGroupBox();
	QString createCalculateAndOptionsGroupBox();

    int returnRadioTextAsInt() const {
            for ( int x = 0; x < radioVector->size(); ++x ){
                if ( radioVector->at( x )->isChecked() )
                    return radioVector->at( x )->text().toInt();
            }
            return 0;
    }
};

#endif //RANKCALCULATOR_H